package com.xjc.business.controller.classadmin;

import com.xjc.business.entity.vo.classadmin.ChatMsgContainer;
import com.xjc.business.service.ChatMsgService;
import com.xjc.business.service.SysMsgService;
import com.xjc.system.constants.MyConstants;
import com.xjc.system.exception.MyException;
import com.xjc.system.result.Result;
import com.xjc.system.result.ResultCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 徐锦程
 * 时间:2025-02-14 14:31
 */
@RestController
@RequestMapping("/class_admin/windows")
public class ClassWindowsController {

    @Autowired
    ChatMsgService chatMsgService;

    /**
     * 获取聊天消息列表
     * @param classAdminIdKey 辅导员id
     * @return 数据
     */
    @GetMapping("/chatMsgContainer/{classAdminIdKey}")
    public Result<List<ChatMsgContainer>> getChatMsgContainer(@PathVariable(value = "classAdminIdKey",required = false) String classAdminIdKey){
        if (classAdminIdKey == null){
            throw new MyException(ResultCode.SUCCESS.getCode(), MyConstants.PARAM_MISSING);
        }

        return chatMsgService.getChatMsgContainer(classAdminIdKey);
    }
}